{% extends "space/rest/index.html" %}
{% load pagination_tags %}
{% block right_container %}
<script type="text/javascript"> 

function deleteDish(id){
	if(confirm("是否删除?")){
		window.location.href="/space/rest/dish/del/"+id+"/";
	}
}
</script>
      
    <div class="admin_position">商户管理 > 菜式列表</div>
    
        <div class="admin_mer_onSell" >
     {% autopaginate rest_dishs 10%}
     {% if state == 'sell'%}
    
     <table class="zpc_ad_list"><tbody>
           <tr>
              <td colspan="6" class="admin_top_title">正在销售的菜式</td>
           </tr>
           <tr class="admin_title">

              <td>菜式名称及图片</td>
              <td>价格</td>
              <td>菜式介绍</td>
              <td>所属目录</td>
              <td>是否为招牌菜</td>
              <td>操作</td>
           </tr>
           {% for rest_dish in rest_dishs %}	
           <tr>
              <td class="dish_picName">
              	<img alt="" width="140" height="140" src="/image/{{rest_dish.img}}" id="edit_ad1">
              	<br>{{rest_dish.name}}
              </td>
              <td>{{rest_dish.price}}</td>
              <td>{{rest_dish.desc}}</td>
              <td>{{rest_dish.cuisine}}</td>
              <td>
              	{% if rest_dish.special %}
              		是
              	{% else %}
              		否
              	{% endif %}
              </td>

              <td class="dish_onSell_edit"><a href="{{rest_dish.id}}/update/">编辑</a> <a href="/space/rest/dish/{{rest_dish.id}}/unsell/">下架</a></td>
           </tr>
           {% endfor%}
          
        
                   
          </tbody></table>
         {% endif %}
         
         
         {% if state == 'unsell'%}
    
     <table class="zpc_ad_list"><tbody>
           <tr>
              <td colspan="6" class="admin_top_title">未销售菜式</td>
           </tr>
           <tr class="admin_title">

              <td>菜式名称及图片</td>
              <td>价格</td>
              <td>菜式介绍</td>
              <td>所属目录</td>
              <td>是否为招牌菜</td>
              <td>操作</td>
           </tr>
           {% for rest_dish in rest_dishs %}	
           <tr>
              <td class="dish_picName">
              	<img alt="" width="100" height="100" src="/image/{{rest_dish.img}}" id="edit_ad1">
              	<br>{{rest_dish.name}}
              </td>
              <td>{{rest_dish.price}}元</td>
              <td>{{rest_dish.desc}}</td>
              <td>{{rest_dish.cuisine}}</td>
              <td>
              	{% if rest_dish.special %}
              		是
              	{% else %}
              		否
              	{% endif %}
              </td>

              <td class="dish_onSell_edit">
              	<a href="{{rest_dish.id}}/update/">编辑</a>
              	<a href="/space/rest/dish/{{rest_dish.id}}/sell/">上架</a> 
              	<a href="#" onclick="deleteDish('{{rest_dish.id}}')">删除</a>
              </td>
           </tr>
           {% endfor%}
          
        
                   
          </tbody></table>
         {% endif %} 
         
         {% paginate %}
         
          </div>   
     
     

     
{% endblock %}
